# Contributor: John Gebbie <me@johngebbie.com>
# Maintainer: John Gebbie <me@johngebbie.com>
pkgname=noggin
pkgver=0.1
pkgrel=4
pkgdesc="Face tracking utility, often for playing games"
url="https://sr.ht/~geb/noggin"
# limited by onnxruntime and opencv
arch="all !x86 !s390x !riscv64"
license="GPL-3.0-only"
depends="onnxruntime"
makedepends="go scdoc opencv-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~geb/noggin/archive/$pkgver.tar.gz"
options="!check" # no test suite

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

export NOGGIN_VERSION="$pkgver"
export NOGGIN_MODEL_PACKAGE=noggin-model
export NOGGIN_SKIP_CHECKS=yes
export NOGGIN_SKIP_EXAMPLES=yes

build() {
	NOGGIN_SKIP_INSTALL=yes ./install.sh "$pkgdir" /usr/bin
}

package() {
	install -Dm755 noggin -t "$pkgdir/usr/bin"
	NOGGIN_SKIP_BINARY=yes NOGGIN_SKIP_MODELS=yes ./install.sh "$pkgdir" /usr/bin
}

sha512sums="
5da081eb8cb51ac3460d7e4c427a844ca95f50f768a9ada9e5fde2644b1cc51ae9f2745eccf88ecf0f49a6fd5c1fcc36d827ee1f32d1c4550fe65547f9baaf09  noggin-0.1.tar.gz
"
